package peer.p2pnet;

import java.net.InetAddress;

public class SourceNodeIdent {
	public InetAddress assistNodeIp;
	public int assistNodePort;
	public int assistSessionId;
	int hashCode;
	public SourceNodeIdent(int assistSessionId,InetAddress assistNodeIp,int assistNodePort){
		this.assistNodeIp=assistNodeIp;
		this.assistNodePort=assistNodePort;
		this.assistSessionId=assistSessionId;
		hashCode=(assistNodeIp.toString()+assistNodePort+assistSessionId).hashCode();
	}
	
	public int hashCode(){
		return hashCode;
	}
	
	public boolean equals(Object ob){
		SourceNodeIdent sn=( SourceNodeIdent)ob;
		if(ob==null){
			return false;
		}else{
			return assistNodeIp.equals(sn.assistNodeIp)&assistNodePort==sn.assistNodePort&assistSessionId==sn.assistSessionId;
		}
	}

}
